package cloud.seri.auth.service.dto

import javax.validation.constraints.DecimalMax
import javax.validation.constraints.DecimalMin
import javax.validation.constraints.Max
import javax.validation.constraints.Min
import javax.validation.constraints.NotNull
import javax.validation.constraints.Pattern
import javax.validation.constraints.Size
import java.io.Serializable
import java.util.Objects

/**
 * A DTO for the [cloud.seri.auth.domain.Menu] entity.
 */
data class MenuDTO(

    var id: String? = null,

    @get: NotNull
    @get: Size(max = 30)
    var text: String? = null,

    var i18n: String? = null,

    var group: Boolean? = null,

    var link: String? = null,

    var externalLink: String? = null,

    var target: String? = null,

    var icon: String? = null,

    var disabled: Boolean? = null,

    var hide: Boolean? = null,

    var hideInBreadcrumb: Boolean? = null

) : Serializable {

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is MenuDTO) return false
        if (other.id == null || id == null) return false

        return Objects.equals(id, other.id)
    }

    override fun hashCode(): Int {
        return id.hashCode()
    }
}
